<?php

require_once 'Core/Db/Table/Abstract.php';
require_once 'Core/Db/Table/Row/Abstract.php';
require_once 'Core/Db/Table/Rowset/Abstract.php';

class Nld_Models_Jobs_Tranning_Entry_DbTable extends Core_Db_Table_Abstract
{
	public function init()
	{
		$this->_name 						= 'vl_tranning_entry';
		$this->_primary 				= 'id';
		$this->_rowClass 				= 'Nld_Models_Jobs_Tranning_Entry_Row';
		$this->_rowsetClass 		= 'Core_Db_Table_Rowset_Abstract';
		
		$this->_dependentTables = array(
			'Category' 		=> Nld_Models::getTableClass('Jobs/Tranning/Category'),
		);
		
		$this->_referenceMap 	= array(
			array(
				'columns'           => 'category',
				'refTableClass'     => Nld_Models::getTableClass('Jobs/Tranning/Category'),
				'refColumns'        => 'id',
				'onDelete'          => self::CASCADE,
        'onUpdate'          => self::CASCADE,
			),
    );
	}
	public function getStatus($index = null)
  {
		$list = array('Ngừng kích hoạt', 'Kích hoạt');
    return ($index === null)?$list:@$list[intval($index)];
  }
}